<!doctype html><html><head>
<meta charset="utf-8" />
<link href="./style/css/bootstrap.css?=<%=timer%>" rel="stylesheet">
<link href="./style/css/bootstrap-theme.css" rel="stylesheet">
<link href="./style/css/font-awesome.css" rel="stylesheet">
<link href="./style/css/index.css?=<%=timer%>" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="renderer" content="webkit" />
<title><%=siteName%>-网站后台管理</title>
</head>
<body>
<div class="wrapper">
	<header class="main-header">
		<a href="<%=siteUrl%>" class="logo" target="_blank">
			<strong class="logo-lg"><%=siteName%></strong>
		</a>
		<nav class="navbar navbar-static-top" role="navigation">
			<div class="navbar-custom-menu">
				<ul class="nav navbar-nav">
					<li>
						<a target="main_frame" href="./cache.asp?q=clean">
							<i class="glyphicon glyphicon glyphicon-refresh"></i>
							<span>清除缓存</span>
						</a>
					</li>
					<li>
						<a href="./login.asp?q=out">
							<i class="glyphicon glyphicon-log-out"></i>
							<span><%=adminInfo(2)%> [注销]</span>
						</a>
					</li>
				</ul>
			</div>
		</nav>
	</header>
	<aside id="main_sidebar" class="main-sidebar">
		<section class="sidebar">
			<ul class="sidebar-menu" id="menu_box"></ul>
		</section>
	</aside>
	<section class="content-wrapper right-side" id="frame_box">
		<iframe id="main_frame" name="main_frame" src="./main.asp?=<%=timer%>" frameborder="0" width="100%" height="100%"></iframe>
	</section>
</div>
<script src="./style/js/jquery-2.1.4.min.js"></script>
<script src="./style/js/bootstrap.min.js"></script>
<script src="./style/js/admin.js?<%=timer%>"></script>
<script>
$(document).ready(function () {
	//禁止在框架里打开首页
	if(window.top != window) {
		top.location.href = './index.asp?<%=timer%>';
	}
	var menu_box = $('#menu_box'),
	li = [
		'<li><a href="./index.asp"><i class="fa fa-home"></i><span>后台管理首页</span></a></li>'
	],
	menus = [
		{
			text: '内容管理', //标题文本
			ico: 'fa-list-alt', //图标
			list: [
				{
					text: '简介管理',
					ico: 'fa-users',
					link: 'our.asp?q=index'
				},
				{
					text: '添加简介',
					ico: 'fa-plus',
					link: 'our.asp?q=edit'
				},
				{
					text: '产品管理',
					ico: 'fa-certificate',
					link: 'product.asp?q=index'
				},
				{
					text: '添加产品',
					ico: 'fa-plus',
					link: 'product.asp?q=edit'
				},
				{
					text: '文章管理',
					ico: 'fa-list',
					link: 'news.asp?q=index'
				},
				{
					text: '添加文章',
					ico: 'fa-plus',
					link: 'news.asp?q=edit'
				},
				{
					text: '留言管理',
					ico: 'fa-book',
					link: 'book.asp?q=index'
				}
			]
		},
		{
			text: '模板标签', //标题文本
			ico: 'fa-table', //图标
			list: [
				{
					text: '模板管理',
					ico: 'fa-th-list',
					link: 'view.asp?q=index'
				},
				{
					text: '添加模板',
					ico: 'fa-plus',
					link: 'view.asp?q=edit'
				},
				{
					text: '生成所有模板',
					ico: 'fa-copy',
					link: 'view.asp?q=update'
				},
				{
					text: '自定义标签管理',
					ico: 'fa-tags',
					link: 'custom.asp?q=index'
				},
				{
					text: '添加自定义标签',
					ico: 'fa-plus',
					link: 'custom.asp?q=edit'
				},
				{
					text: '内容链接管理',
					ico: 'fa-link',
					link: 'link.asp?q=index'
				},
				{
					text: '添加内容链接',
					ico: 'fa-plus',
					link: 'link.asp?q=edit'
				}
			]
		},
		{
			text: '分类管理', //标题文本
			ico: 'fa-list', //图标
			list: [
				{
					text: '大类管理',
					ico: 'fa-list-ol',
					link: 'genre.asp?q=index'
				},
				{
					text: '添加大类',
					ico: 'fa-plus',
					link: 'genre.asp?q=edit'
				},
				{
					text: '栏目管理',
					ico: 'fa-list-ol',
					link: 'class.asp?q=index'
				},
				{
					text: '添加栏目',
					ico: 'fa-plus',
					link: 'class.asp?q=edit'
				}
			]
		},
		{
			text: '站务管理', //标题文本
			ico: 'fa-cogs', //图标
			list: [
				{
					text: '更新设置',
					ico: 'fa-undo',
					link: 'config.asp?q=update'
				},
				{
					text: '查看缓存',
					ico: 'fa-paste',
					link: 'cache.asp?q=index'
				},
				{
					text: '批量替换',
					ico: 'fa-refresh', //exchange
					link: 'replace.asp?q=index'
				},
				{
					text: '文件管理',
					ico: 'fa-file',
					link: 'file.asp?q=index'
				}
				<%if isSuper then%>
				,{
					text: '网站设置',
					ico: 'fa-cog',
					link: 'config.asp?q=index'
				},
				{
					text: '添加变量',
					ico: 'fa-retweet',
					link: 'config.asp?q=edit'
				},
                {
                    text: '备份列表',
                    ico: 'fa-hdd-o',
                    link: 'database.asp?q=index'
                },
                {
                    text: '数据库备份',
                    ico: 'fa-save',
                    link: 'database.asp?q=backup'
                },
                {
                    text: '错误日志',
                    ico: 'fa-building',
                    link: 'log.asp?q=index'
                }
                <%end if%>
			]
		},
		{
			text: '管理员', //标题文本
			ico: 'fa-user', //图标
			list: [
				{
					text: '管理员管理',
					ico: 'fa-user',
					link: 'admin.asp?q=index'
				},
				{
					text: '添加管理员',
					ico: 'fa-plus',
					link: 'admin.asp?q=edit'
				},
				{
					text: '修改我的信息',
					ico: 'fa-edit',
					link: 'admin.asp?q=edit&id=<%=adminInfo(0)%>'
				}
			]
		}
	];
	$.each(menus, function(i, n) {
		li.push('<li class="treeview"><a href="javascript:;">');
		li.push('<i class="fa '+n.ico+'"></i><span>'+n.text+'</span>');
		li.push('<i class="fa fa-angle-left pull-right"></i></a>');
		li.push('<ul class="treeview-menu">');
		$.each(n.list, function(j, k) {
			li.push('<li><a href="./'+k.link+'" target="main_frame">');
			li.push('<i class="fa '+k.ico+'"></i>'+k.text+'</a></li>');
		});
		li.push('</ul></li>');
	});
	li.push('<li><a href="http://git.oschina.net/cjasp/cjasp" target="_blank"><i class="fa fa-book text-red"></i><span>使用教程</span></a></li>');
	li.push('<li><a href="http://asp.cjasp.com" target="_blank"><i class="fa fa-book text-red"></i><span>系统演示</span></a></li>');
	menu_box.html(li.join(''));
	$('#main_frame').on('load', function(){
        var frame = $(this);
        try {
            var self = frame.contents();
            $(this.contentWindow).on('scroll', function(){
                var height = $(this.document.body).outerHeight();
                frame.stop(true, true).animate({height: height + 50}, 200);
            });
            frame.height($(window).height())
            .stop(true, true).animate({
                height: self.outerHeight(),
                'min-height': $(window).height()
            }, 200);
        } catch(a){
            frame.height($('body').height());
        }
    });
	$(this)
	.on('click', '.treeview', function () {
		var self = $(this), ul = self.find('ul.treeview-menu'),
		angle_down = self.find('a i.fa-angle-left');
		if(self.hasClass('active')){
		    ul.slideUp(300, function() {
                self.removeClass('active');
		    });
            angle_down.removeClass('angle-left-down');
		} else {
		    ul.slideDown(300, function() {
		        self.addClass('active');
            });
            angle_down.addClass('angle-left-down');
		}
	})
	.on('click', '.treeview-menu li', function (e) {
		e.stopPropagation();
		$('body,html').animate({'scrollTop': 0}, 300);
		$(this).addClass('active').siblings('li').removeClass('active');
	})
	//防止304页面缓存，加上随机数
	.on('click', '#menu_box a', function() {
		var self = $(this), href = self.attr('href');
		if(href != 'javascript:;') {
			if(href.indexOf('&rand=') > -1) {
				href = href.replace(/&rand=\d+/i, function(a, b) {
					return '&rand=' + new Date().valueOf();
				})
			} else {
				href = cj.param(href, 'rand=' + new Date().valueOf());
			}
			self.attr('href', href);
		}
	})
});
</script>
</body>
</html>